<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>弹性伸长</title>
    <style>
      .container {
        display: flex;
        width: 700px;
        height: 400px;
        background-color: #ccc;
      }

      .item1 {
        /* 
          子项属性: flex-grow   弹性项目的伸长
          默认值为:0 , 表示项目不伸长,设置成不同的数值表示瓜分剩余空间的比例

          注意: 取值的数值并不是子项元素空间占用的比例,而是元素在未伸长时,剩余空间的瓜分比例!!!
        */
        flex-grow: 1;
        /* width: 150px; */
        height: 150px;
        background-color: palegreen;
      }

      .item2 {
        flex-grow: 2;
        /* width: 150px; */
        height: 150px;
        background-color: paleturquoise;
      }

      .item3 {
        flex-grow: 1;
        /* width: 150px; */
        height: 150px;
        background-color: pink;
      }

      .item4 {
        flex-grow: 1;
        /* width: 150px; */
        height: 150px;
        background-color: peachpuff;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="item1">111</div>
      <div class="item2">222</div>
      <div class="item3">333</div>
      <div class="item4">444</div>
    </div>
  </body>
</html>
